package me.itsoo.artemis.framework.ioc.exception;

import me.itsoo.artemis.framework.core.util.StringUtils;

/**
 * NoSuchBeanException
 *
 * @author zxy
 * @version 0.0.1
 * @since 2023/6/2
 */
public class NoSuchBeanException extends RuntimeException {

    private static final long serialVersionUID = -9046794281980385204L;

    private final String errorMsg;

    public NoSuchBeanException(String beanName) {
        this.errorMsg = StringUtils.format("Could not found bean of name: '{}'", beanName);
    }

    @Override
    public String getMessage() {
        return errorMsg;
    }

    @Override
    public synchronized Throwable fillInStackTrace() {
        return this;
    }
}
